<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title></title>
    <link href="css/mui.min.css" rel="stylesheet"/>
   	<link rel="stylesheet" href="iconfont/iconfont.css">
   	<style type="text/css">
   		.iconfontItem {
   			font-family: "iconfont" !important;
   			position: relative;
   			z-index: 20;
   			font-size: 10px;
   			font-weight: 400;
   			line-height: 1;
   			font-style: normal;
   			-webkit-font-smoothing: antialiased;
   			-moz-osx-font-smoothing: grayscale;
   			color: #929292;
   			display: inline-block;
   			text-decoration: none;
   			top: 4px;
   			width: 24px;
   			height: 24px;
   			padding-top: 0;
   			padding-bottom: 0;
   		}
		#iconSize{
			font-size:18px;
			top:6px;
		}
		#select>.mui-active>.mui-icon{
			color:#007aff;
		}
		
		/* .mui-bar-tab .mui-tab-item.mui-active{
			color:#007aff ;
		}
		.mui-bar .mui-icon:active{
			opacity:1;
		} */
		
		
   	</style>
</head>
<body>
</body>
 <script src="js/mui.min.js"></script>
 <script src="js/common.js"></script>
 <script src="js/tabutil.js"></script>
 <script src="js/nv-bar.js"></script>
 <script src="js/jquery-3.2.1.min.js"></script>
 <script src="js/jquery.md5.js"></script>
 
 <script type="text/javascript" charset="utf-8">
	mui.init();
	var first = null;
	mui.back = function(){
		if(!first){
			first = new Date().getTime();
			mui.toast('再按一次退出应用');
			setTimeout(function(){
				first = null;
			},1000);
		}else{
			if(new Date().getTime()-first<1000){
				plus.runtime.quit();
			}
		}
	}
	
	mui.plusReady(function(){
	
		var self = plus.webview.currentWebview();
		var aniShow = {};
		util.initSubpage(aniShow);
		
		//初始化相关参数
		var nview = plus.nativeObj.View.getViewById('tabBar'),
			activePage = plus.webview.currentWebview(),
			targetPage,
			subpages = util.options.subpages,
			pageW = window.innerWidth,
			currIndex = 0;
		
		/**
		 * 根据判断view控件点击位置判断切换的tab
		 */
		nview.addEventListener('click', function(e) {
		
			var clientX = e.clientX;
			if(clientX >= 0 && clientX <= parseInt(pageW * 0.33)) {
				currIndex = 0;
			} else if(clientX > parseInt(pageW * 0.3) && clientX <= parseInt(pageW * 0.6)) {
				currIndex = 1;
			} else if(clientX > parseInt(pageW * 0.6) && clientX <= parseInt(pageW * 1.0)){
				currIndex = 2;
			} 
			var string  =plus.webview.getWebviewById(subpages[currIndex].id);
			
			// 匹配对应tab窗口
			if(plus.webview.getWebviewById(subpages[currIndex].id) == plus.webview.currentWebview()) {
				return;
			} else {
				targetPage = plus.webview.getWebviewById(subpages[currIndex].id);
			} 
			
			if(targetPage == activePage) {  
				 return;  
			} 
			
			//底部选项卡切换
			util.toggleNview(currIndex);
			// 子页面切换
			util.changeSubpage(targetPage, activePage, aniShow);
			//更新当前活跃的页面
			activePage = targetPage; 
		
		}); 
			
			
	});
	
	

	
 </script>
</html>

      	
  